<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>商品详情</title>
		<link href="../static/bootstrap-3.3.7/css/bootstrap.min.css" rel="stylesheet">
		<link rel="stylesheet" href="../static/css/details.css" />
		<link href="../static/css/common.css" rel="stylesheet">
		<link rel="stylesheet" href="../static/css/goodsDetails.css">
		<link rel="stylesheet" href="../static/css/hb.css">
	</head>
	<body>
		<!-- 引用头部 -->
		<!--<div id="heardInclud"></div>-->

		<div id="heardInclud" class="header">

				<div class="header-d  auto">
					<span>你好，欢迎来到东东推！东东推软件用户群：49794450 东东推官方采集群：602839873 东东推官方微信号：maijixiaoxiao</span>
					<div class="header-lj">
						<div class="lian">链接工具</div>
						<!--<div>放单中心</div>-->
						<div class="deng">
							<a href="login.html">登录</a> | <a href="register.html">注册</a>
						</div>
						<div>
						<span class="zhong" style="margin-right:15px ;">个人中心</span>
						<span class="tui">退出</span>
						</div>
					</div>
				</div>

			</div>

			<div class="header-zhong">
				<div class="header-z-d auto">
					<img src="../static/images/logo2.png">
					<input type="text" placeholder="请输入宝贝名称" class="seek">
					<button class="sou">
						<img src="../static/images/fangdajing.png">
					</button>

					<!--<div class="gz">
						<div class="gong">
							<img src="../static/images/Group 28.png">
							<div>东东推公众号</div>
						</div>
						<div class="gong">
							<img src="../static/images/Group 28.png">
							<div>东东推APP</div>
						</div>
					</div>-->

				</div>
			</div>

			<div class="nav">
				<ul class="auto" id="ul">
					<li>商品分类
						<div class="er">
							<span>服务</span>
							<span>母婴玩具</span>
							<span>美妆个护</span>
							<span>居家生活</span>
							<span>居家生活</span>
						</div>
					</li>
					<li><a href="../index.html">首页</a><div class="er"></div></li>
					<li><a href="newRealTime.html">实时上新</a>
						<div class="er">
						</div>
					</li>
					<li><a href="choiceness.html">精选好货</a>
						<div class="er">
						</div>
					</li>
					<li><a href="discounts.html">优惠券池</a>
						<div class="er">
						</div>
					</li>
					<li><a href="commission.html">高佣专区</a>
						<div class="er">
						</div>
					</li>
					<li><a href="seckill.html">秒杀专区</a>
						<div class="er">
						</div>
					</li>
					<!--<li class="miao panel-default"><a href="pen.html">新科录音笔软件下载</a>
						<div class="er">
						</div>
					</li>-->
				</ul>
			</div>
		
		<div class="container-fluid ">
			<div class="backgroundH" >
				<div class="container" style="height: 50px;line-height: 50px">
					  <span class="breadcrumbGoods"><mark style="background: #F2F2F2">实时上新></mark>倍轻松（breo）颈部按摩器 4D颈椎按摩披肩 敲打揉捏 肩颈按摩仪</span>
				</div>
			</div>
			<div class="container goodsDetailsCon newdetail" style="margin-bottom: 70px;">
				
			</div>
		  <script type="text/x-handlebars-template" id="detail-template">
		  	
		  	<div class="row">
					<div class="col-md-5" style="padding-right: 25px;">
						<img class="imagesMain img-responsive" src="{{mainImageUrl}}" class="img-responsive" style="width: 448px;height: 448px;border: 1px solid #dedede;">
					</div>
					<div class="col-md-7 ">
						{{#if type "jd"}}
							<h4 style="color: #5D5D5D;font-size: 18px;line-height: 1.5;font-weight: 600;margin-left: -10px;"><img class="imagesJd" src="../static/images/jingdong.png">{{goodsName}}</h4>
						{{else}}
							<h4 style="color: #5D5D5D;font-size: 18px;line-height: 1.5;font-weight: 600;margin-left: -10px;"><img class="imagesJd" src="../static/images/yh.png">{{goodsName}}</h4>

						{{/if}}
						<div class="row goodsOrCouPriceCon">
							{{#if type "jd"}}
				        	<div class="col-xs-3 goodsPrice" style="padding-left: 0;"><span style="color: #333333;font-size: 14px!important;"><strong>京东价：</strong></span><span style="font-weight: bold;">￥</span>{{conPrice}}</div>
				        	{{else}}
				        	<div class="col-xs-3 goodsPrice" style="padding-left: 0;"><span style="color: #333333;font-size: 14px!important;"><strong>友惠价：</strong></span><span style="font-weight: bold;">￥</span>{{conPrice}}</div>
				        	{{/if}}
				        	<div class="col-xs-7 goodsOrCouPrice">
				        		<div class="row">
				        			<div class="col-xs-1"><img src="../static/images/kuohao.png"></div>
					        		<div class="col-xs-11" style="margin-left: -15px;">
					        			<p style="padding-left: 2px;color: #c3c3c3;">原价{{price}}</p>
					        			<p style="padding-left: 2px;color: #c3c3c3;">优惠劵{{couponMoney}} &nbsp;优惠券有效期: {{couponTime}}</p>
					        		</div>
				        		</div>
				        	</div>
				        </div>
				        <div class="row backgroundH goodsCommisionCon">
				        	<div class="col-xs-6">
				        		<div class="row">
				        			<div class="col-xs-6" style="text-align: left;">比例：<b style="font-weight: normal;">{{wlCommissionShare}}%</b></div>
				        			<div class="col-xs-6" style="text-align: left;">佣金：<b style="font-weight: normal;"><span >￥</span>{{wlCommission}}</b></div>
				        		</div>		
				        	</div>
				        </div>
				        
						<div class="row">
							{{#if type "yh"}}
							<div class="jian">
								<span>此商品由：<b>友惠家</b> 提供</span>
								<span>推荐理由：Ta没有话跟你说！如果你觉得好，就转发出去吧！^_^</span>
							</div>
							{{/if}}
						</div>

				        <!-- 暂定，设计还没有完善 -->
						
				        <div class="row xianshi" style="margin-top: 240px" >
					      	<div class="col-xs-3" style="padding:0; margin-right: -25px;" ><a href="#" class="tui btn btn-nowSpread vocherBut" role="button" style="width: 132px!important;height: 46px!important;line-height: 46px;padding: 0;" vouchId="{{id}}">立即推广</a> </div>
					      	<div class="col-xs-3 aa"  style="padding:0;"><a data-clipboard-action="copy" data-clipboard-target="#copy1_{{id}}" style="width: 132px!important;height: 46px!important;line-height: 46px;padding: 0;" class="fuzhi btn btn-copyLink copybut" role="button" id="{{mainImageUrl}},{{goodsName}},{{price}},{{conPrice}},{{conUrl}},{{skuId}},{{goodsUrl}},{{couponUrl}}">复制文案</a></div>
					      	<!--<div   id="copy1_{{id}}" style="width: 0rem;height: 0rem;font-size: 0px;">-->
								  <div class="row btnImagesToppp" style="display: none;">
									  <div class="sanjiao"></div>
								  <div  id="copy1_{{id}}" style="width: 417px;position: absolute;top: 250px;left: 280px; background:#ffffff;padding: 16px; border-radius: 10px;z-index: 99;word-wrap:break-word;box-shadow: 0 8px 18px 4px rgba(0,0,0,0.10);" >
										<img src="{{mainImageUrl}}" style="width: 120px;height: 120px;margin-bottom: 14px;">
										<p>{{goodsName}}</p>
										{{#if type "jd"}}
											<p>京东价：{{price}}元</p>
										{{else}}
											<p>友惠价：{{price}}元</p>
										{{/if}}
										<p>券后价：{{conPrice}}元</p>
										<p>领券：</p>
										<p>{{couponUrl}}</p>
										<p>抢购：{{goodsUrl}}</p>
							</div>
								  </div>
					    </div>
					    
					</div>
				</div>
		  	
		  	
		  	
		  </script>

			<div class="container similarGoods" style="margin-bottom: 26px;">
				<div class="row"  style="border-bottom: 1px solid #FF2040;" >
					<div class="col-xs-6 text-left">
						<h4 style="margin: 0;height: 46px;line-height: 46px;"><strong style="font-size: 18px;color: #333333;font-weight: normal;">相似商品</strong></h4>				
					</div>
					<div class="col-xs-6 text-right"><h5 style="margin: 0;height: 46px;line-height: 46px;">查看更多></h5></div>
				</div>
			</div>
			
			<div class="container">
				<div class="row" id="resemain">
				   <script type="text/x-handlebars-template" id="resble-template">
					{{#each this}}
						{{#if_eq @index 7}}
					<div class="col-xs-12 col-sm-6 col-md-4 col-lg-3" style="height: 444px;margin-bottom: 15px;">
						<div class="thumbnail goodsContent" data_id="{{id}}" style="padding: 15px;height: 430px;border-radius: 0;">
					      <img class="goodsImages tu" src="{{mainImageUrl}}" data_id="{{id}}" alt="..." style="width: 232.5px;height: 232.5px;">
					      <!--<div class="row btnImagesTop">
					      	<div class="col-xs-6" style="padding-right: 0;"><a  class="btn btn-nowSpread extdenbut" role="button" extend_id="{{id}}">立即推广</a> </div>
					      	<div class="col-xs-6" style="padding-left: 0;"><a data-clipboard-action="copy" data-clipboard-target="#copy_{{id}}" class="btn btn-copyLink copbuy" role="button" id="{{mainImageUrl}},{{goodsName}},{{price}},{{conPrice}},{{conUrl}},{{skuId}}">复制文案</a></div>
								  <div  id="copy1_{{id}}" style="width: 380px; position:absolute;top:100px;left: 260px; background:#ffffff;padding: 16px; border-radius: 10px;z-index: 99;word-wrap:break-word;box-shadow: 0 8px 18px 4px rgba(0,0,0,0.10)" >
										<img src="{{mainImageUrl}}" style="width: 120px;height: 120px;margin-bottom: 14px;">
										<p>{{goodsName}}</p>
										{{#if type "jd"}}
											<p>京东价：{{price}}元</p>
										{{else}}
											<p>友惠价：{{price}}元</p>
										{{/if}}
										<p>券后价：{{conPrice}}元</p>
										<p>领券：{{conUrl}}</p>
										<p>抢购：http://item.jd.com/{{skuId}}.html</p>
							</div>
							
					      </div>-->
					      
					      
					      <div class="row btnImagesTop">
					      	<div class="col-xs-6" style="padding-right: 0;"><a  class="btn btn-nowSpread extdenbut" role="button" extend_id="{{id}}">立即推广</a> </div>
					      	<div class="col-xs-6" style="padding-left: 0;"><a data-clipboard-action="copy" data-clipboard-target="#copy1_{{id}}" class="btn btn-copyLink copbuy" role="button" id="{{mainImageUrl}},{{goodsName}},{{price}},{{conPrice}},{{conUrl}},{{skuId}}">复制文案</a></div>
								  
							
					      </div>
					      
					      
					      <div class="row btnImagesTopp" style="display: none;">
					      	<div  id="copy1_{{id}}" style="width: 380px; position:absolute;top:100px;left: 250px; background:#ffffff;padding: 16px; border-radius: 10px;z-index: 99;word-wrap:break-word;box-shadow: 0 8px 18px 4px rgba(0,0,0,0.10)" >
										<img src="{{mainImageUrl}}" style="width: 120px;height: 120px;margin-bottom: 14px;">
										<p>{{goodsName}}</p>
										{{#if type "jd"}}
											<p>京东价：{{price}}元</p>
										{{else}}
											<p>友惠价：{{price}}元</p>
										{{/if}}
										<p>券后价：{{conPrice}}元</p>
										<p>领券：{{conUrl}}</p>
										<p>抢购：http://item.jd.com/{{skuId}}.html</p>
							</div>
					      </div>
					      
					      
					      
					      <div class="caption" style="padding: 0;" data_id="{{id}}">
					        <!--<h5 style="height: 39px;line-height: 1.5;display: -webkit-box;-webkit-box-orient: vertical;-webkit-line-clamp: 2;overflow: hidden;">
					        	<img  class="imagesJd" src="../static/images/jingdong.png" >{{goodsName}}</h5>-->
					        	{{#if_eq spuPlatform "jd"}}
								<h5 style="height: 39px;line-height: 1.5;display: -webkit-box;-webkit-box-orient: vertical;-webkit-line-clamp: 2;overflow: hidden;">
					        	<img  class="imagesJd" src="../static/images/jingdong.png" >{{goodsName}}</h5>
								{{else}}
									<h5 style="height: 39px;line-height: 1.5;display: -webkit-box;-webkit-box-orient: vertical;-webkit-line-clamp: 2;overflow: hidden;">
					        	<img  class="imagesJd" src="../static/images/yhh.png" >{{goodsName}}</h5>
	
								{{/if_eq}}
					        	
					        <div class="row">
					        	<div class="col-xs-7 goodsPrice"><span style="font-weight: bold;">￥</span>{{conPrice}}</div>
					        	<div class="col-xs-4 goodsOrCouPrice">
					        		<div class="row">
					        			<div class="col-xs-2"><img src="../static/images/kuohao.png"></div>
						        		<div class="col-xs-10">
						        			<p>原价 {{price}}</p>
						        			<p>优惠劵 {{couponMoney}}</p>
						        		</div>
					        		</div>
					        	</div>
					        	<!--<div class="col-xs-4 goodsCommision text-right">
					        		<p>比例：<b>{{wlCommissionShare}}%</b></p>
					        		<p>佣金：<span class="glyphicon glyphicon-yen" aria-hidden="true"></span><b>{{wlCommission}}</b></p>
					        	</div>-->
					        </div>
					        <div class="row goodsCouponVali">
					        	<div class="col-xs-3"><img  src="../static/images/jingdongpeisong.png"></div>
					        	
					        	{{#if_eq couponExpiredTime ""}}
					        	<div class="col-xs-9" style="margin-top: 1px;padding-left: 10px;margin-top: 1px;overflow: hidden!important;height: 17px;!important"></div>
					        	{{else}}
					        	<div class="col-xs-9" style="margin-top: 1px;padding-left: 10px;margin-top: 1px;overflow: hidden!important;height: 17px;!important">优惠券有效期: {{couponExpiredTime}}</div>
					        	{{/if_eq}}
					        	
					        </div>
					        
					        <div class="row" style="padding: 0 15px;">
								<div class="goodsCommision text-center">
									<p class="col-xs-6" style="height: 24px;border: 1px solid #FFD7DD;margin-top:9px;color: #8F8F8F; background: #F6F6F6;padding: 0!important;">比例：<b style="font-weight: normal;display: inline-block;margin-top:2px; ">20%</b></p>
									<p class="col-xs-6" style="height: 24px;border: 1px solid #FFD7DD;margin-top:9px;color: #8F8F8F; background: #F6F6F6;padding: 0!important;border-left:none;">佣金：
										<!--<span class="glyphicon glyphicon-yen" aria-hidden="true"></span>-->
										<span>￥</span><b style="font-weight: normal;display: inline-block;margin-top: 3px; ">{{wlCommission}}</b></p>
								</div>
							</div>
					        
					        
					      </div>
						</div>
					</div>
					{{/if_eq}}
					{{/each}}
					</script>
					
					
				</div>
			</div>
		</div>
		<!--<div id="footerInclud"></div>-->

		<div id="footerInclud" class="footer">
				<div class="footer-d auto">
					<div class="footer-d-u">
						<h4>什么是东东推？</h4>
						<span>东东推是专门给京东为推广做的社群分享推广平台，单独招商。京东是中国最大的电商商城，有2000万个单品，社群的朋友通过东东推能够以<h style='color: #ff2040;'>5折起的优惠价格</h>购买到京东仓库直发的京东正品。东东推是京东战略合作伙伴，也是领先推广平台。</span>
					</div>
					<div class="footer-d-u">
						<h4>东东推有什么优势？</h4>
						<span>东东推专注于让推手获得更好的推广体验，有完善的产品库，优质的爆品，肉单实时更新。专注于更专业的京挑客退关平台，为京挑客提供更好的软件和服务。</span>
					</div>
					<!--<div class="footer-d-u">
						<div>
							<img src="./static/images/Group 28.png">
							<div>东东推公众号</div>
						</div>
						<div>
							<img src="./static/images/Group 28.png">
							<div>东东推公众号</div>
						</div>
					</div>-->
				</div>
				<div class="footer-dd auto" >
					<p style="color: #666666 ">地址：天津市武清区创业总部基地B11 联系方式：022-82175867 官方QQ群：497974450</p>
					<p style="color:#B2B2B2 ">Copyright © 2014 - <h class='shi'></h> 京ICP备18006432号-1</p>
				</div>
			</div>
		
	<script src="../static/js/jquery-1.9.1.min.js" type="text/javascript"></script>
	<script type="text/javascript" src="../static/jquery-qtip/jquery.qtip.min.js" ></script>
	<script type="text/javascript" src="../static/js/config.js" ></script>
	<script type="text/javascript" src="../static/js/handlebars-v4.0.10.js"></script>
	<script type="text/javascript" src="../static/js/clipboard.min.js"></script>
	<script type="text/javascript" src="../static/js/anv.js"></script>

	<script>
		var myDate = new Date();
			//获取当前年
			var year=myDate.getFullYear();
			$('.shi').text(year)
		
		
		Handlebars.registerHelper('if', function(v1, v2, opts) {
		if(v1 == v2)
			return opts.fn(this);
		else
			return opts.inverse(this);
		});
		Handlebars.registerHelper('if_eq', function(v1, v2, opts) {
        if(v1 <= v2)
            return opts.fn(this);
        else
            return opts.inverse(this);
    });
         $(document).ready(function(){
         	
//       	$("#heardInclud").load("../common/heard.html");
//        	$("#footerInclud").load("../common/footer.html");
          	
          	
			
			
			
			
			var detailTmpl = $('#detail-template').html();
			var detailPage = Handlebars.compile(detailTmpl);
			var href = window.location.href;
			var id = href.split('?')[1].split('=')[1];
			$.ajax({
				url: C.interface.comdetailInter,
				type: 'get',
				dataType: 'json',
				data: {id:id},
				success: function(data) {
					if(data.code == "10000") {
//						console.log(data);
						$(".newdetail").html(detailPage(data.data));
						var json = data.data;
						$(".container").attr('cateId',json.categoryCode);
						reseble(json.categoryCode);
						$(".breadcrumbGoods").html(json.goodsName);
						$(".copybut").qtip({ 
							content: '<img class="goodsImages" width="120px" src="'+json.mainImageUrl+'" alt="..."><p>'+json.goodsName+'</p><p>京东价：'+json.price+'元</p><p>券后价：'+json.conPrice+'元</p><p>领券：</p><p>'+json.couponUrl
									+'</p><p>抢购：</p>'
									+json.conUrl+'<p>'+json.goodsUrl+'</p>'
						}); 
						
//						$(".xianshi").mouseover(function(){
//							// alert(1)
//							$(this).find(".btnImagesTop").show();
//						});
//						$(".xianshi").mouseout(function(){
//							$(this).find(".btnImagesTop").hide();
//						});
						$('.aa').mouseover(function(){
							$('.btnImagesToppp').show()
						})
						$('.aa').mouseout(function(){
							$('.btnImagesToppp').hide()
						})

						var clipboard = new Clipboard('.copybut');
					    clipboard.on('success', function(e) {
//					        console.log(e);
					    });
					
					    clipboard.on('error', function(e) {
//					        console.log(e);
					    });
					   //立即推广的按钮、
						$(".vocherBut").click(function(){
							
							var token = localStorage.getItem('token');
							//	console.log(token)
								
							if (token != "" && token != null){
								 $(".goodsContent").unbind();
								var id = $(this).attr('vouchId');
								window.location.href ="back/chainTool/chainTool.html?id="+id
								
							}else{
								window.location.href = 'login.html'
							}
							
							
							
						})
					}
				}
			})
         })
         var resTmpl = $('#resble-template').html();
		 var resPage = Handlebars.compile(resTmpl);
         function reseble(obj){
//       	console.log(obj);
         	$.ajax({
				url: C.interface.choisegood,
				type: 'get',
				dataType: 'json',
				data: {categoryCode:obj},
				success: function(data) {
					if(data.code == "10000") {
						//console.log(data);
						$("#resemain").html(resPage(data.data.list));
						eventmain();
						var clipboard = new Clipboard('.copbuy');
					    clipboard.on('success', function(e) {
//					        console.log(e);
					    });
					
					    clipboard.on('error', function(e) {
//					        console.log(e);
					    });
					    
					    $(".caption").click(function(){
							var id= $(this).attr("data_id");
							window.location.href="goodsDetails.html?id="+id
						});
						$(".tu").click(function(){
							var id= $(this).attr("data_id");
							window.location.href="goodsDetails.html?id="+id
						});
					    
					    /* 商品模块hover显示按钮 */
						$(".goodsContent").mouseover(function(){
							$(this).find(".btnImagesTop").show();
						});
						$(".goodsContent").mouseout(function(){
							$(this).find(".btnImagesTop").hide();
						});
						
						$('.copbuy').on("mouseover",function(){
						   var index = $('.copbuy').index($(this));
						   $('.btnImagesTopp').eq(index).show();
						})
						$('.copbuy').on("mouseleave",function(){
						   var index = $('.copbuy').index($(this));
						   $('.btnImagesTopp').eq(index).hide();
						})
						
				
					    $(".btn-copyLink").qtip({ 
							content:{  
		                		text:function (){
		                			var str = $(this).attr("id");
		                			var arr=new Array();
									arr = str.split(',');
									var img =  arr[0];
									var goodsName =  arr[1];
									var price =  arr[2];
									var conPrice =  arr[3];
									var linkUrl =  arr[4];
									var skUrl =  'http://item.jd.com'+arr[5]+'/.html';
		                			var con = '<img class="goodsImages" width="120px" src="'+img+'" alt="..."><p>'+goodsName+'</p><p>京东价：'+price+'元</p><p>券后价：'+conPrice+'元</p>'+linkUrl+'<p>领券：</p><p></p><p>抢购：</p>'+
		                			'<p>'+ skUrl +'</p>'
		                			return con;
		                		}
		                	}
							/*content: '<img class="goodsImages" width="120px" src="'+img+'" alt="..."><p>【买2送1 国妆特证】【一喷一抹 30天祛味断根】植物草本萃取，天然成分不过敏不伤肤！</p><p>芊茗草狐臭液喷剂30天根治狐臭</p><p>京东价：48元</p><p>券后价：29元</p><p>领券：</p><p>http://coupon.m.jd.com/coupons/show.action?key=ce63374f6522472584b0c8b0acc3e63d&roleId=10558331&to=mall.jd.com/index-143672.html</p><p>抢购：</p><p>\rhttp://item.jd.com/21590088027.html</p>',*/
						}); 
						 $(".extdenbut").click(function(){
						 	
						 	var token = localStorage.getItem('token');
					//	console.log(token)
						
					if (token != "" && token != null){
						$(".goodsContent").unbind();
						   		var id = $(this).attr("extend_id");
								   window.location.href = "back/chainTool/chainTool.html?id="+id
					}else{
						window.location.href = 'login.html'
					}
						 	
						   	    
						   })
					}
				}
			})
         }
         
         
         function  eventmain(){
         	$(".goodsContent").click(function(){
         		var id = $(this).attr('data_id')
				// window.location.href="goodsDetails.html?id="+id
				
			});
         }
         
         
         $(".lian").click(function(){
				var url = window.location.pathname; 
				var token = localStorage.getItem('token');
							//	console.log(token)
								
			if (token != "" && token != null){
							
					window.location.href = "back/chainTool/chainTool.html"
								
			}else{
				window.location.href = 'login.html'
			}
							
					   		 
		})
         
    </script>
	</body>
</html>
